-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MWPW-152082 - Utils to Scripts #209
Conversation
[Release] Stage to Main
[Release] Stage to Main
…dency. Leaves utils.js as other code in our repo calls getLibs
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only reference to set/getlibs? Don't we use them in tests too?
We do use I don't think the removal of the import from scripts ought to effect anything, but Dennis should probably run a full smoke test. |
Oh yeah. I didn't notice that you hadn't deleted utils.js. I assumed you were moving the function, not duplicating it. I don't understand how that works. Isn't |
In this instance, not so sure the closure matters since the function runs immediately and returns the get/set pattern and scripts looks for the global of I left the function in utils because quite a bit of our code uses |
It's a bit over-engineered for what it does, we are passing a const and not using the second parameter or second function. If we're not changing function getLibs() {
const { hostname, search } = window.location;
if (!(hostname.includes('.hlx.') || hostname.includes('local'))) return LIBS;
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
} No need for a |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #209 +/- ##
========================================
Coverage ? 96.28%
========================================
Files ? 12
Lines ? 1105
Branches ? 0
========================================
Hits ? 1064
Misses ? 41
Partials ? 0 ☔ View full report in Codecov by Sentry. |
@JasonHowellSlavin Shouldn't this be working? https://utils-to-scripts--bacom--adobecom.hlx.page/drafts/methomas/tree-view |
Also, what about the tests? If we don't need to set the libs anymore, can we remove that from the tests? |
We need some tests here, this is too important not to test. |
Agreed, but I think we're talking about two different things:
|
@Brandon32 , I will adapt the For point 2. I think we need to look into that issue separately from this. There is some flakiness in our tests as they stand now, we may need an issue to look into them and refactor a bit. Right now many of the tests are throwing errors into the Browser logs, but are still passing, like tree-view, redirects-formatter, etc. |
After discussing with team, and in light of my absence for a few weeks, we are closing this PR in favor of #220. |
To Test:
When testing, please make sure you do the following at least:
aem up
Resolves: MWPW-152082
Test URLs:
Verification URLS for Consumer Blocks
https://utils-to-scripts--bacom--adobecom.hlx.page/docs/library/blocks/chat-cta
https://utils-to-scripts--bacom--adobecom.hlx.page/docs/library/blocks/comparison-table
https://utils-to-scripts--bacom--adobecom.hlx.page/docs/library/blocks/event-speakers
https://utils-to-scripts--bacom--adobecom.hlx.page/docs/library/blocks/stats
https://utils-to-scripts--bacom--adobecom.hlx.page/docs/library/blocks/tree-view
https://utils-to-scripts--bacom--adobecom.hlx.page/docs/library/blocks/workfront-login